/*
 *    Copyright © OpenAtom Foundation.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.inspur.edp.bff.api.manager.context;

import com.inspur.edp.cef.entity.changeset.IChangeDetail;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * 修改上下文
 * 修改前，修改，修改后扩展动作共用一个修改上下文
 * 扩展动作执行顺序可参考：<a href=https://open.inspuronline.com/iGIX/#/document/mddoc/docs-gsp-cloud-ds%2Fdev-guide-beta%2Fadvanced-development%2Fvo-relatedcomponent-development%2F%E6%89%A9%E5%B1%95%E5%8A%A8%E4%BD%9C%2Fvo%E6%89%A9%E5%B1%95%E5%8A%A8%E4%BD%9C.md">点击这里</a>查看。
 */
public class ModifyContext {

    private ArrayList<IChangeDetail> sourceChange = new ArrayList<IChangeDetail>();
    private HashMap<String, ArrayList<IChangeDetail>> mappedChange = new HashMap<String, ArrayList<IChangeDetail>>();
    private HashMap<String, ArrayList<IChangeDetail>> innerChange = new HashMap<String, ArrayList<IChangeDetail>>();
    private ArrayList<IChangeDetail> targetChange = new ArrayList<IChangeDetail>();

    /**
     * 源变更集（外部传入）
     */
    public final ArrayList<IChangeDetail> getSourceChange() {
        return sourceChange;
    }

    public final void setSourceChange(ArrayList<IChangeDetail> value) {
        sourceChange = value;
    }

    /**
     * 映射后的变更集集合
     * Key：数据源编号,内部默认Key值使用Default，开发时请注意不要使用该Key值,以免出现未知问题。
     * Value：数据源对应变更集
     */
    public final HashMap<String, ArrayList<IChangeDetail>> getMappedChange() {
        return mappedChange;
    }

    public final void setMappedChange(HashMap<String, ArrayList<IChangeDetail>> value) {
        mappedChange = value;
    }

    /**
     * 内部变更集合，执行完变更操作后，将内部变更集写入
     * Key：数据源编号,内部默认Key值使用Default，开发时请注意不要使用该Key值,以免出现未知问题。
     * Value：数据源对应内部变更集
     */
    public final HashMap<String, ArrayList<IChangeDetail>> getInnerChange() {
        return innerChange;
    }

    public final void setInnerChange(HashMap<String, ArrayList<IChangeDetail>> value) {
        innerChange = value;
    }

    /**
     * vo内部变更集：通过{@link #innerChange}反向映射合并后的结果
     */
    public final ArrayList<IChangeDetail> getTargetChange() {
        return targetChange;
    }

    public final void setTargetChange(ArrayList<IChangeDetail> value) {
        targetChange = value;
    }

}
